﻿Imports System.Resources
Imports System.Threading
Imports Biz
Imports BLL
Imports DevComponents.DotNetBar


Public Class ctrlNuevoPostulante
    Private _llamador As frmMainMetro
    Private _RM As ResourceManager


    Public Sub SetIdioma()

        _RM = New ResourceManager("UI.Idiomas", System.Reflection.Assembly.GetExecutingAssembly)

        btnAceptar.Text = _RM.GetString("btnAceptar")
        btnCancelar.Text = _RM.GetString("btnCancelar")

    End Sub

    Public Property Llamador() As frmMainMetro
        Get
            Return _llamador
        End Get
        Set(value As frmMainMetro)
            _llamador = value
        End Set
    End Property

    Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
        _llamador.CloseModalPanel(Me, DevComponents.DotNetBar.Controls.eSlideSide.Left)
    End Sub

    Public Sub CargarComboTipoDocumento()
        Dim oTipoDocumento As cTipo_Documento
        Dim colObjetos As Collection
        Dim cmbItem As ComboBoxItem


        _RM = New ResourceManager("UI.Idiomas", System.Reflection.Assembly.GetExecutingAssembly)

        cmbTipoDocumento.BeginUpdate()

        cmbTipoDocumento.Items.Clear()

        cmbItem = New ComboBoxItem

        cmbItem.Tag = ""
        cmbItem.Text = _RM.GetString("strComboSeleccioneItem")

        cmbTipoDocumento.Items.Add(cmbItem)

        Try
            colObjetos = GestorTipo_Documento.Instance.Consultar

            If Not colObjetos Is Nothing Then

                For Each oTipoDocumento In colObjetos

                    cmbItem = New ComboBoxItem

                    cmbItem.Tag = oTipoDocumento.TDoc_Codigo
                    cmbItem.Text = oTipoDocumento.TDoc_Descrip

                    cmbTipoDocumento.Items.Add(cmbItem)
                Next
            End If

            cmbTipoDocumento.SelectedIndex = 0

        Catch ex As Excepciones.Tipo_DocumentoFalloConsultar
            Main.ManejarExcepcion(ex)
        Catch ex As Exception
            Main.ManejarExcepcion(ex)
        End Try

        cmbTipoDocumento.EndUpdate()

    End Sub

End Class
